package DoublyLinkedListSentinel;

import java.util.Iterator;
//双向链表 (带哨兵)
public class DoublyLinkedListSentinel implements Iterator<Integer> {
    static class Node{
        Node prev;
        int value;
        Node next;

        public Node(Node prev, int value, Node next) {
            this.prev = prev;
            this.value = value;
            this.next = next;
        }
    }
    //头部哨兵和尾部哨兵
    private Node head;
    private Node tail;
    public DoublyLinkedListSentinel() {
        head = new Node(null,666,null);
        tail = new Node(null,888,null);
    }

    @Override
    public boolean hasNext() {
        return false;
    }

    @Override
    public Integer next() {
        return null;
    }

    private Node findNode(int index) {
        int i = -1;
        for (Node p = head;p != tail;p = p.next) {
            if (i == index) {
                return p;
            }
        }
        return null;
    }
}
